package com.pactera.madp.cp.api.feign;

import com.pactera.madp.common.core.constant.SecurityConstants;
import com.pactera.madp.common.core.constant.ServiceNameConstants;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestHeader;

/**
 * @File name：com.pactera.madp.cp.api.feign.RemoteTaskPubService
 * @Create on：2022/5/12
 * @Author：tianq
 */
@FeignClient(contextId = "remoteTaskPubService", value = ServiceNameConstants.CP_SERVICE)
public interface RemoteTaskPubService {

    /**
     * 自动启动/结束任务
     * @param from
     */
    @PutMapping("/taskpub/update-status")
    void startTask(@RequestHeader(SecurityConstants.FROM) String from);

    @PutMapping("/taskpub/task-completion-statistics")
    void taskCompletionStatistics(@RequestHeader(SecurityConstants.FROM) String from);

    @DeleteMapping("/taskpub/overdue-tasks")
    void deleteOverdueTasks(@RequestHeader(SecurityConstants.FROM) String from);
}
